-- GENERATED SPELL FOR [Shadowforge Surveyor] --


function spell0_4844(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(9053,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_4844', 3000, 1)
end

function spell1_4844(pUnit, Event) --@Frost Armor,Self--
pUnit:FullCastSpellOnTarget(12544,pUnit)
pUnit:RegisterEvent('Sorts_4844', 0, 1)
end

function spell2_4844(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(11831,pUnit)
pUnit:RegisterEvent('Sorts_4844', 8284, 1)
end

function Sorts_4844(pUnit, Event)
local choix_sorts_4844 = math.random(0, 2)
if choix_sorts_4844 == 0 then
pUnit:RegisterEvent('spell0_4844', 1, 1)
end
if choix_sorts_4844 == 1 then
pUnit:RegisterEvent('spell1_4844', 1, 1)
end
if choix_sorts_4844 == 2 then
pUnit:RegisterEvent('spell2_4844', 1, 1)
end
end

function mob4844_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_4844', math.random(1500, 3000), 1)
end

function mob4844_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob4844_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob4844_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(4844, 1, 'mob4844_Action')
RegisterUnitEvent(4844, 2, 'mob4844_Leave')
RegisterUnitEvent(4844, 3, 'mob4844_Kill')
RegisterUnitEvent(4844, 4, 'mob4844_Die')
